<%@ page language="java" import="data.*,logic.*,java.util.*" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SOS PLANET - Ayuda al mundo</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div id="wrapper">
<div class="content">
<div id="header">
	<%@ include file = "includes/header.jsp" %>
</div><!-- header -->

<div id="menu">      
	<%@ include file = "includes/menu.html" %>
</div><!-- menu -->
           
<div class="destino">
<h1>ACTIVIDADES</h1>
</div>

<div class="mainactivity">
<%
//buscador
String s = request.getParameter("iddest");
ActivityStore as = ActivityStore.getInstance();
List<Activity> la = new LinkedList<Activity>();

if(request.getParameter("findbutton") != null){
	String name = request.getParameter("name");
	String dest = request.getParameter("destiny");
	String type = request.getParameter("type");
	List<String> ls = new LinkedList<String>();
	ls.add(name);
	ls.add(dest);
	ls.add(type);
	la = as.newActivityFind(ls);
}else if(s != null){
	la = as.selectActivitiesFromDestination(s);
}//buscador
for(Activity a: la){
		
	%>
	<form action="FrontController?res=Actividad.jsp" method="post">
	<input type="hidden" name="idact" value="<%= a.getId() %>" />
	<input class="buyproductlarge" type="submit" value="<%= a.getName() %>" />
	</form>
	
	<%

	
}
%>
</div>

<div id="footer">
	<%@ include file = "includes/footer.html" %>
</div><!--footer-->

</div><!--content-->
</div><!--wrapper-->
</body>
</html>